push down filter: consider already pushed filters #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If optimizer runs several times it can try to push filters into table provider several times. But,
supports_filters_pushdown
may be context-dependent. For example, it may support any filter likecolumn=value
but not the both at the same time.Consider the following optimizer run:
a = 1, b = 1
.supports_filters_pushdown
returns [Exact, Inexact] Ok, will remember thata=1
is pushed and make a filter node forb=1
....
Another optimization iteration.
b = 1
.supports_filters_pushdown
returns [Exact]. Of course, the table provider can't remember all pushed filters. So, there is nothing to left but to answer: "Exact". Now, the optimizer thinks that conjunctiona = 1 AND b = 1
is supported exactly, but it's not.To prevent this problem, this patch adds already pushed filters to the
supports_filters_pushdown
call.